package dao;

import java.util.HashMap;

import org.w3c.dom.Document;

import databean.ItemBean;

import utility.Util_Trading;

public class AddFixedPriceItemDAO {
	
	public static String addFixedPriceItem(ItemBean item){
		
		HashMap<String,String> data = new HashMap<String,String>();
		
		data.put("Title", item.getTitle());
		data.put("Description", item.getDescription());
		data.put("PayPalEmailAddress", item.getPayPalEmailAddress());
		data.put("StartPrice", item.getStartPrice());
		data.put("UPC", item.getUPC());
		data.put("Quantity", item.getQuantity());
		
		Document response = Util_Trading.sendRequest("AddFixedPriceItem.txt", data);
		String item_id = response.getElementsByTagName("ItemID").item(0).getChildNodes().item(0).getNodeValue();
		return item_id;
		
	}
}
